import request from "@/utils/request";



// GET /admin/acl/user/{page}/{limit} 获取用户分页列表
export const getUserPageListApi = (page, limit, username) => {
  return request.get(`/admin/acl/user/${page}/${limit}?username=${username}`,);
};

// POST /admin/acl/user/save 新增用户管
export const saveUserApi = (User) => {
  return request.post(`/admin/acl/user/save`, User);
};

// PUT /admin/acl/user/update 修改用户管理
export const updateUserApi = (User) => {
  return request.put(`/admin/acl/user/update`, User);
};

// DELETE /admin/acl/user/remove/{id}删除用户管理
export const removeUserApi = (id) => {
  return request.delete(`/admin/acl/user/remove/${id}`);
};



// GET /admin/acl/user/toAssign/{userId} 根据用户管理id 获取角色列表
export const toAssignApi = (userId) => {
  return request.get(`/admin/acl/user/toAssign/${userId}`);
};

// POST /admin/acl/user/doAssign  根据用户分配角色
export const doAssingApi = (userId, roleId) => {
  return request({
    url: `/admin/acl/user/doAssign`,
    method: "post",
    params: {
      userId,
      roleId
    }
  });
};

// POST /admin/acl/user/batchRemove 根据id列表删除用户
export const batchRemoveApi = (userIdList) => {
  return request.post(`/admin/acl/user/batchRemove`, userIdList);
};